package com.jt.auth.service;

import com.jt.auth.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * Feign远程调用接口,在此接口中对sso-system服务进行远程调用.
 */
@FeignClient(value = "sso-system",contextId = "remoteUserService" )
public interface RemoteUserService {
    /**
     * 基于用户名查询用户信息
     * @param username
     * @return
     */
    @GetMapping("/user/login/{username}")
    public User selectUserByUsername(
            @PathVariable("username") String username);
    /**
     * 基于用户id获取用户权限信息
     * @param userId
     * @return
     */
    @GetMapping("/user/permission/{userId}")
    public List<String> selectUserPermissions(
            @PathVariable("userId") Long userId);
}
